<?php
	session_start();
	include '../../lib/common/dbRoutines.php';
	include '../../lib/dao/WordDao.php';
	
	$answer = "";
	
	//$word = iconv("UTF-8", "windows-1251", $_POST['word']);
	$word = $_POST['word'];
	
	if(isset($_SESSION['user'])){
		
		$conn = getDbConnection();  
		$wordDao = new WordDao($conn); 
		
		$answer = $wordDao -> delete_word($word);
	}
	else{
		$answer = "error_in_delete_word - session is not set!";
	}
	
	echo $answer;
?>